class Video < ActiveRecord::Base
  has_one :active_job
  has_one :completed_job
  has_many :notifications

  validates_presence_of :url
  validates_presence_of :title
  validates_presence_of :filename
  
  validates_uniqueness_of :url, :case_sensitive => false
  validates_uniqueness_of :filename, :case_sensitive => false
  validates_format_of :url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
  
end